<div class="portlet">
    <form class="portlet-search-body" name="queryForm">
        <input type="text" class="form-control search-item" ng-model="vehicleNo" placeholder="自编号">
        <input type="text" class="form-control search-item" ng-model="vehicleNoAbbr" placeholder="小自编号">
        <input type="text" class="form-control search-item" ng-model="plateNo" placeholder="车牌号">
        <input type="text" class="form-control search-item" ng-model="lineNo" placeholder="线路号">
        <input type="text" class="form-control search-item" ng-model="companyName" placeholder="经营单位">
        <div class="search-item">
            <button class="btn btn-icon-only default"><i class="fa fa-chevron-right"></i></button>
            <button class="btn btn-sm query" ng-click="grid.query();"><i class="fa fa-search"></i> 查询</button>
            <button class="btn btn-sm reset" ng-click="grid.reset();"><i class="fa fa-eraser"></i> 重置</button>
            <button class="btn btn-sm query" ng-click="grid.syncMediaBus();">
                <i class="fa fa-refresh"></i> 刷新车辆
            </button>
        </div>

    </form>
    <div class="portlet-body">
        <table ed-grid="grid"  class="table table-striped table-bordered table-advance table-hover"
               data-options="url: 'bus/query.do', modelText: '车辆列表', form: 'queryForm', modal: 'modal'">
            <thead>
                <tr>
                    <th data-options="field: '_index'"></th>
                    <th data-options="field: 'vehicleNo'">自编号</th>
                    <th data-options="field: 'vehicleNoAbbr'">小自编号</th>
                    <th data-options="field: 'plateNo'">车牌号</th>
                    <th data-options="field: 'lineNo'">线路号</th>
                    <th data-options="field: 'companyName'">经营单位</th>
                    <th data-options="field: 'busType'">车型</th>
                    <th data-options="field: 'busMakeType'">制作车型</th>
                    <th data-options="field: 'year'">年限</th>
                    <th data-options="field: 'stopPlace'">停车点</th>
                    <th data-options="field: 'status | code : bus_status'">状态</th>
                    <th>操作</th>
                </tr>
            </thead>
        </table>
    </div>
</div>

<div ed-modal="modal" data-options="title: '车辆编辑', static: true, width: 720, defaultButton:false,onHidden:'reset'">
    <form action="#" class="form-horizontal w5c-form" w5c-form-validate novalidate name="validateForm">
        <div class="form-body">
        	<div class="form-group">
				<label class="col-md-2 control-label">自编号</label>
				<div class="col-md-4">
					<input type="text" class="form-control" name="vehicleNo" ng-model="bus.vehicleNo" readonly>
            	</div>
				<label class="col-md-2 control-label">小自编号</label>
				<div class="col-md-4">
					<input type="text" class="form-control" name="vehicleNoAbbr" ng-model="bus.vehicleNoAbbr" readonly>
            	</div>
            </div>
        	<div class="form-group">
				<label class="col-md-2 control-label">车牌号</label>
				<div class="col-md-4">
					<input type="text" class="form-control" name="plateNo" ng-model="bus.plateNo" readonly>
            	</div>
				<label class="col-md-2 control-label">线路号</label>
				<div class="col-md-4">
					<input type="text" class="form-control" name="lineNo" ng-model="bus.lineNo" readonly>
            	</div>
            </div>
        	<div class="form-group">
				<label class="col-md-2 control-label">经营单位</label>
				<div class="col-md-4">
					<input type="text" class="form-control" name="companyName" ng-model="bus.companyName" readonly>
            	</div>
				<label class="col-md-2 control-label">车型</label>
				<div class="col-md-4">
					<input type="text" class="form-control" name="busType" ng-model="bus.busType" required>
            	</div>
            </div>
        	<div class="form-group">
				<label class="col-md-2 control-label">制作车型</label>
				<div class="col-md-4">
					<input type="text" class="form-control" name="busMakeType" ng-model="bus.busMakeType" required>
            	</div>
				<label class="col-md-2 control-label">年限</label>
				<div class="col-md-4">
					<input type="text" class="form-control" name="year" ng-model="bus.year" required>
            	</div>
            </div>
        	<div class="form-group">
				<label class="col-md-2 control-label">停车点</label>
				<div class="col-md-4">
					<input type="text" class="form-control" name="stopPlace" ng-model="bus.stopPlace" required>
            	</div>
				<label class="col-md-2 control-label">状态</label>
				<div class="col-md-4">
                    <select class="form-control" name="status" ng-model="bus.status"
                            ng-options="opt.value as opt.name for opt in options.bus_status" disabled>
                        <option value="" disabled selected hidden>-- 状态 --</option>
                    </select>
            	</div>
            </div>
        </div>
        <div class="form-actions">
            <button type="button" class="btn default" ng-click="grid.cancel();">
                <i class="fa fa-times"></i> 取消
            </button>
            <button type="button" class="btn blue" ng-click="grid.save();">
                <i class="fa fa-times"></i> 确定
            </button>
        </div>
    </form>
</div>


<div ed-modal="busTransModal" data-options="title:'车辆异动明细',icon:'fa-bus',static:true,width:'900px',defaultButton:false">
    <div style="padding: 5px;width: 100%;overflow-y: auto;overflow-x: hidden;height:350px;">
        <form action="#" class="form-horizontal w5c-form" w5c-form-validate novalidate name="busTransModalForm">
            <div class="portlet-body">
                <table class="table table-striped table-bordered table-hover dataTable" style="width: 100%;font-size: 9px;">
                    <thead>
                    <tr style="">
                        <th style="text-align: center;font-weight: bold;">异动时间</th>
                        <th style="text-align: center;font-weight: bold;">异动详情</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-show="busTransList != undefined && busTransList.length > 0" role="row" ng-repeat="transData in busTransList">
                        <td style="text-align: center">{{transData.vehTransferTime | limitTo : '10'}}</td>
                        <td style="text-align: center">
                            <span ng-show="transData.type == '1'">
                                从<span style="color: red">{{transData.companyOut}}</span> 调至 <span style="color: red">{{transData.companyIn}}</span>,
                                线路从<span style="color: red">{{transData.lineOut}}</span> 调至 <span style="color: red">{{transData.lineIn}}</span>
                            </span>

                            <span ng-show="transData.type == '2'">
                                从<span style="color: red">{{transData.companyOut}}</span> 调至 <span style="color: red">{{transData.companyIn}}</span>
                            </span>

                            <span ng-show="transData.type == '3'">
                                从<span style="color: red">{{transData.companyOut}}</span> 调至 <span style="color: red">{{transData.companyIn}}</span>,
                                车辆性质从<span style="color: red">{{transData.beforeBusKind}}</span> 变更为 <span style="color: red">{{transData.afterBusKind}}</span>,
                                车辆分类从<span style="color: red">{{transData.beforeBusSort}}</span> 变更为 <span style="color: red">{{transData.afterBusSort}}</span>
                            </span>
                        </td>
                    </tr>
                    <tr ng-show="busTransList == undefined || busTransList.length == 0" role="row" >
                        <td style="text-align: center" colspan="2">暂无调动记录</td>
                    </tr>
                    </tbody>
                </table>
            </div>

            <div class="form-actions" style="position: absolute;right: 17px;bottom: 23px;">
                <button type="button" class="btn blue" ng-click="cancelBusTransModal();">
                    <i class="fa fa-times"></i> 确定
                </button>
            </div>
        </form>
    </div>
</div>


<div ed-modal="adHistoryModal" data-options="title: '广告历史', static: true, width: 720, defaultButton:false">
    <form action="#" class="form-horizontal w5c-form" w5c-form-validate novalidate name="adHistoryForm">
        <div class="portlet-body" style="height: 350px; overflow-y: auto">
            <table class="table table-striped table-bordered table-advance table-hover">
                <thead>
                    <tr>
                        <th>自编号</th>
                        <th>车牌号</th>
                        <th>线路号</th>
                        <th>运营公司</th>
                        <th>客户名称</th>
                        <th>广告内容</th>
                        <th>完工时间</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="history in historyList">
                        <td>{{history.vehicleNo}}</td>
                        <td>{{history.plateNo}}</td>
                        <td>{{history.lineNo}}</td>
                        <td>{{history.companyName}}</td>
                        <td>{{history.customerName}}</td>
                        <td>{{history.adName}}</td>
                        <td>{{history.finishTime | limitTo : 10}}</td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="form-actions" style="position: absolute;right: 17px;bottom: 23px;">
            <button type="button" class="btn blue" ng-click="cancelAdHistoryModal();">
                <i class="fa fa-times"></i> 确定
            </button>
        </div>
    </form>
</div>


<div ed-modal="busPositionModal" data-options="title:'车辆定位',icon:'fa-bus',static:true,width:'1100px',defaultButton:false">
    <div id="busPositionModalMapDiv" style="overflow: auto;height: 600px;width: 100%;">
    </div>
</div>

